//
//  KBBottomView.swift
//  KimboWeiBoSwift
//
//  Created by kimbo on 15/12/21.
//  Copyright © 2015年 kimbo. All rights reserved.
//

import UIKit

class KBBottomView: UIView {
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        backgroundColor = UIColor(white: 0.9, alpha: 1)
        
        setupUI()
    }
    
    /// 设置UI
    private func setupUI() {
        addSubview(forwardButton)
        addSubview(commentButton)
        addSubview(zanButton)
        addSubview(firstSeparatorView)
        addSubview(SecondSeparatorView)
        
        //添加约束
        self.ff_HorizontalTile([forwardButton, commentButton, zanButton], insets: UIEdgeInsets())
        
        firstSeparatorView.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: forwardButton, size: nil)
        
        SecondSeparatorView.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: commentButton, size: nil)
    }

    // MARK: - 懒加载
    private lazy var forwardButton: UIButton = UIButton(title: "转发", imageName: "timeline_icon_retweet", fontSize: 11)
    
    private lazy var commentButton: UIButton = UIButton(title: "评论", imageName: "timeline_icon_comment", fontSize: 11)

    private lazy var zanButton: UIButton = UIButton(title: "赞", imageName: "timeline_icon_unlike", fontSize: 11)
    
    private lazy var firstSeparatorView: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))
    
    private lazy var SecondSeparatorView: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))
    
}
